package com.zaimokuza.cn.util.grace;


import com.zaimokuza.cn.entity.enums.CustomizeExceptionEnum;
import com.zaimokuza.cn.entity.exception.CustomizeException;

/**
 * 优雅处理异常的统一封装
 *
 * @author zaimokuza
 */
public class GraceException {

    /**
     * 根据枚举抛出指定异常
     *
     * @param customizeExceptionEnum 枚举
     */
    public static void display(CustomizeExceptionEnum customizeExceptionEnum) {
        throw new CustomizeException(customizeExceptionEnum);
    }

    /**
     * 根据枚举抛出指定异常，并自定义提示信息
     *
     * @param customizeExceptionEnum 枚举
     * @param resultMsg              提示信息
     */
    public static void display(CustomizeExceptionEnum customizeExceptionEnum, String resultMsg) {
        throw new CustomizeException(customizeExceptionEnum, resultMsg);
    }

}
